package com.itheima.stock.job;

import com.itheima.stock.service.StockTimerTaskService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author by itheima
 * @Date 2022/3/21
 * @Description 定义配置xxljob执行任务的bean对象
 */
@Component
public class StockTimerJob {

    @Autowired
    private StockTimerTaskService stockTimerTaskService;

    @XxlJob("testXxlJob")
    public void testXxlJob(){
        System.out.println("testXxlJob run....");
    }


    @XxlJob("getInnerMarketInfos")
    public void getInnerMarketInfos(){
        stockTimerTaskService.getStockRtIndex();
    }


    @XxlJob("getAshareInfos")
    public void getAshareInfos(){
        stockTimerTaskService.getStockSectorRtIndex();
    }


}
